package com.cdqidi.core.weixinmanager.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;


/**
 * 公众号模板消息
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class TemplateMsgDetailedDTO extends BaseQuery {

    @ExcelIgnore
    @JsonIgnore
    private static final String EXCEL_TITLE = "公众号模板消息";
    /**
     * 主键
     */
    @ExcelProperty(value = {EXCEL_TITLE, "ID"})
    @NotBlank(message = "ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String id;
    /**
     * 模板id
     */
    @ExcelProperty(value = {EXCEL_TITLE, "模板id"})
    @NotBlank(message = "模板id不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "模板id长度不能超过{max}位", groups = DefaultGroup.class)
    private String templateId;
    /**
     * 模板编号
     */
    @ExcelProperty(value = {EXCEL_TITLE, "模板编号"})
    @NotBlank(message = "模板编号不能为空", groups = DefaultGroup.class)
    @Size(max = 100, message = "模板编号长度不能超过{max}位", groups = DefaultGroup.class)
    private String templateIdShort;
    /**
     * 模板标题
     */
    @ExcelProperty(value = {EXCEL_TITLE, "模板标题"})
    @NotBlank(message = "模板标题不能为空", groups = DefaultGroup.class)
    @Size(max = 200, message = "模板标题长度不能超过{max}位", groups = DefaultGroup.class)
    private String templateTitle;
    /**
     * 模板内容
     */
    @ExcelProperty(value = {EXCEL_TITLE, "模板内容"})
    @NotBlank(message = "模板内容不能为空", groups = DefaultGroup.class)
    @Size(max = 500, message = "模板内容长度不能超过{max}位", groups = DefaultGroup.class)
    private String templateContent;
    /**
     * 公众号
     */
    @ExcelIgnore
    @NotBlank(message = "公众号不能为空", groups = DefaultGroup.class)
    @Size(max = 200, message = "公众号长度不能超过{max}位", groups = DefaultGroup.class)
    private String appId;
    /**
     * 公众号显示
     */
    @ExcelProperty(value = {EXCEL_TITLE, "公众号"})
    private String appIdDisplay;

    @Override
    public void freeData() {
        this.id = null;
        this.templateId = null;
        this.templateIdShort = null;
        this.templateTitle = null;
        this.templateContent = null;
        this.appId = null;
        this.appIdDisplay = null;
        super.freeData();
    }
}
